/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：dataspecification_def.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/04
 * 摘要：数据规范公有的定义
 * 当前版本：1.0
 */

#pragma once

namespace DataSpecificationGW
{
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
    #define Q_NULLPTR NULL
#endif

    // 数据规范版本号
    enum DataSpecificationVersion
    {
        V_1_1_0_0 = 1,          // 山东版本V1.1.0.0
        V_4_1_0_2,               // 公司版本V4.1.0.2
        V_4_1_1_0,               // 公司版本V4.1.1.0
        DefaultDataSpecificationVersion = V_4_1_1_0,
    };

    // 数据文件编码格式
    enum EncodeFormat
    {
        ENCODE_NONE = 0,
        ENCODE_UTF8, //UTF8
        ENCODE_UTF16,//UTF16
        ENCODE_ASCII//ASCII
    };

    // 字符串的类型
    enum StringType
    {
        TYPE_VERSION = 1,       // 作为版本号
        TYPE_UNICODE,
        TYPE_ASCII,
        TYPE_DATETIME,          // 作为时间
    };

    // 存储数据类型编码
    enum StorageDataType
    {
        DATA_TYPE_UNUSED = 0,
        DATA_TYPE_INT8,//1
        DATA_TYPE_UINT8,//2
        DATA_TYPE_INT16,//3
        DATA_TYPE_INT32,//4
        DATA_TYPE_INT64,//5
        DATA_TYPE_FLOAT,//6
        DATA_TYPE_DOUBLE,//7
        DATA_TYPE_UINT16,//8
        DATA_TYPE_DEFAULT = DATA_TYPE_FLOAT
    };

    //图谱性质
    enum SpectrumCharacter
    {
        PROPERTY_UNRECORD = 0xff,//未记录
        PROPERTY_TEST = 0x01,//检测图谱
        PROPERTY_BG_NOISE = 0x02,//背景噪声
        PROPERTY_TEST_BG_NOISE = 0x03,//检测图谱及背景噪声
        PROPERTY_DEFAULT = PROPERTY_UNRECORD
    };

    // 测点的测试部位
    enum TestLocation
    {
        TEST_LOCATION_UNRECORD = 0xff,//0xff:未记录
        TEST_LOCATION_FRONT_MIDDLE = 1,//1: 前中幅
        TEST_LOCATION_FRONT_DOWN,//2: 前下幅
        TEST_LOCATION_BACK_UP,//3：后上幅
        TEST_LOCATION_BACK_MIDDLE,//4：后中幅
        TEST_LOCATION_BACK_DOWN,//5：后下幅
        TEST_LOCATION_SIDE_UP,//6：侧上幅
        TEST_LOCATION_SIDE_MIDDLE,//7：侧中幅
        TEST_LOCATION_SIDE_DOWN,//8：侧下幅
        TEST_LOCATION_DEFAULT = TEST_LOCATION_UNRECORD
    };

    // 幅值单位
    enum AmpUnit
    {
        AMP_UNIT_DB = 0x01,
        AMP_UNIT_DBM, //0x02
        AMP_UNIT_DBmV, //0x03
        AMP_UNIT_DBuV, //0x04
        AMP_UNIT_V, //0x05
        AMP_UNIT_mV, //0x06
        AMP_UNIT_uV, //0x07
        AMP_UNIT_PERCENTAGE, //0x08
        AMP_UNIT_A, //0x09
        AMP_UNIT_mA, //0x0a
        AMP_UNIT_uA, //0x0b
        AMP_UNIT_OHM, //0x0c
        AMP_UNIT_mOHM, //0x0d
        AMP_UNIT_uOHM, //0x0e
        AMP_UNIT_M_PER_S2, //0x0f
        AMP_UNIT_MM, //0x10
        AMP_UNIT_Degree, //0x11
        AMP_UNIT_Fahrenheit, //0x12
        AMP_UNIT_Pa, //0x13
        AMP_UNIT_C, //0x14
        AMP_UNIT_mC, //0x15
        AMP_UNIT_uC, //0x16
        AMP_UNIT_nC, //0x17
        AMP_UNIT_pC, //0x18
        AMP_UNIT_DEFAULT = AMP_UNIT_mV
    };

    // 超声传感器类型
    enum AESensorType
    {
        AE_SENSOR_UNRECORD = 0xff,//未记录
        AE_SENSOR_AIR = 0x01,//空声
        AE_SENSOR_SF6 = 0x02,  //SF6气体绝缘电力设备检测用接触式
        AE_SENSOR_OIL_CHARGE = 0x03, //充油电力设备检测用接触式
        AE_SENSOR_WIRELESS = 0x04,//无线超声传感器
        AE_SENSOR_SURFACE_MOUNT = 0x05,//表贴
        AE_SENSOR_DEFAULT = AE_SENSOR_UNRECORD
    };

    // 频带类型
    enum FrequencyBand
    {
        BAND_UNRECORD = 0xFF,   //未记录（ 文档中一会儿是0，一会儿是255，需要确认）
        BAND_ALL_PASSED = 0x01, //全通
        BAND_LOW_PASSED = 0x02, //低通
        BAND_HIGH_PASSED = 0x03,//高通
        BAND_EXTENDED = 0x04,   //可扩充

        BAND_DEFAULT = BAND_UNRECORD,//默认值
    };

    // 同步源
    enum SyncSource
    {
        SYNC_SOURCE_INNER = 1,//内同步
        SYNC_SOURCE_POWER,//电源同步
        SYNC_SOURCE_LIGHT,//光同步
        SYNC_SOURCE_EXTERNAL,//外同步
        SYNC_SOURCE_DEFAULT = SYNC_SOURCE_INNER
    };

    // 数据有效判断
    enum DataJudgmentFlag
    {
        DATA_NORMAL = 0x00,         //正常
        DATA_LESS_MAX = 0x01,       //小于最大值
        DATA_MORE_MAX = 0x02,       //大于最大值
        DATA_DEFAULT = DATA_NORMAL, //默认值
    };

    //天气
    enum Weather
    {
        WEATHER_UNRECORD = 0xff, //未记录
        WEATHER_SUNSHINE = 0x01, //晴
        WEATHER_OVERCAST = 0x02, //阴
        WEATHER_RAINY = 0x03, //雨
        WEATHER_SNOWY = 0x04, //雪
        WEATHER_FOG = 0x05, //雾
        WEATHER_THUNDERSTORM = 0x06, //雷雨
        WEATHER_CLOUDY = 0x07, //多云
        WEATHER_DEFAULT = WEATHER_UNRECORD
    };

    // 温度单位
    enum TemperatureUnit
    {
        TEMPERATURE_UNIT_CELSIUS = 0x11, // 摄氏度
        TEMPERATURE_UNIT_FAHRENHEIT = 0x12, // 华氏度
        TEMPERATURE_UNIT_DEFAULT = TEMPERATURE_UNIT_CELSIUS
    };

    // 放电严重程度
    enum DischargeSeverity
    {
        DISCHARGE_SEVERITY_LEVEL_0 = 0, // 正常
        DISCHARGE_SEVERITY_LEVEL_1, // 一般
        DISCHARGE_SEVERITY_LEVEL_2, // 严重
        DISCHARGE_SEVERITY_LEVEL_3 // 危急
    };

    // 脉冲间隔时间单位
    enum PulseIntervalUnit
    {
        PULSE_MIC_SECOND = 0x01,  //微秒
        PULSE_MIL_SECOND = 0x02,  //毫秒
        PULSE_SECOND = 0x03, //秒
        PULSE_UNIT_DEFAULT = PULSE_MIL_SECOND
    };

    //图谱类型
    enum SpectrumTypeCode
    {
        SPECTRUM_CODE_MULTI = 0x00,//多图谱
        //HFCT
        SPECTRUM_CODE_HFCT_MULTI = 0x10,//高频多图谱
        SPECTRUM_CODE_HFCT_PRPD = 0x11,//高频prpd图谱
        SPECTRUM_CODE_HFCT_PRPS = 0x12,//高频prps图谱
        SPECTRUM_CODE_HFCT_PULSE_WAVE = 0x13,//高频脉冲波形图谱
        SPECTRUM_CODE_HFCT_WAVE = 0x14,//高频时域波形图
//        SPECTRUM_CODE_HFCT_PERD = 0x15,//高频周期图谱
//        SPECTRUM_CODE_HFCT_AMP = 0x16,//高频幅值图谱
//        SPECTRUM_CODE_HFCT_TF = 0x17,//高频时频图谱

        //UHF
        SPECTRUM_CODE_UHF_MULTI = 0x20,//特高频多图谱
        SPECTRUM_CODE_UHF_PRPD = 0x21,//特高频prpd图谱
        SPECTRUM_CODE_UHF_PRPS = 0x22,//特高频prps图谱
        SPECTRUM_CODE_UHF_PEAK_STATISTICS = 0x23,//特高频峰值统计图
        SPECTRUM_CODE_UHF_WAVE = 0x24,//特高频时域波形图

        //AE
        SPECTRUM_CODE_AE_MULTI = 0x30,//超声多图谱
        SPECTRUM_CODE_AE_AMP = 0x31,//超声特征图
        SPECTRUM_CODE_AE_PHASE = 0x32,//超声相位图
        SPECTRUM_CODE_AE_PULSE = 0x33,//超声脉冲图
        SPECTRUM_CODE_AE_WAVE = 0x34,//超声波形图

        //TEV
        SPECTRUM_CODE_TEV_MULTI = 0x40,//暂态地电压多图谱
        SPECTRUM_CODE_TEV_AMP = 0x41,//暂态地电压幅值
//        SPECTRUM_CODE_TEV_PRPD = 0x42,//暂态地电压PRPD
//        SPECTRUM_CODE_TEV_PRPS = 0x43,//暂态地电压PRPS

        //CA

        //mechanical
        SPECTRUM_CODE_MECH_MULTI = 0x60,//机械特性多图谱
        SPECTRUM_CODE_MECH_ELEC_I = 0x61,//线圈电流
        SPECTRUM_CODE_MECH_ELEC_U = 0x62,//线圈电压
        SPECTRUM_CODE_MECH_MOTOR_I = 0x63,//电机电流
        SPECTRUM_CODE_MECH_MOTOR_U = 0x64,//电机电压
        SPECTRUM_CODE_MECH_CT_I = 0x65,//电流互感器电流
        SPECTRUM_CODE_MECH_SWITCH = 0x66,//开关量
        SPECTRUM_CODE_MECH_ROUTE = 0x67,//行程
        SPECTRUM_CODE_MECH_VIBRA = 0x68,//振动
        SPECTRUM_CODE_MECH_RESIST = 0x69,//回路电阻

        //红外
        SPECTRUM_CODE_INFRARED_MULTI = 0x70,//红外多图谱
        SPECTRUM_CODE_INFRARED = 0x71,//红外

        // 电流幅值
        SPECTRUM_CODE_CURRENT_AMPLITUDE = 0x91, // 电流幅值
    };
}
